package com.xinqi.util.pool;

import org.springframework.boot.web.embedded.tomcat.TomcatWebServer;
import org.springframework.boot.web.server.WebServer;
import org.springframework.stereotype.Component;

import java.util.concurrent.Executor;

/**
 * @author xin麒
 * @date 2023/8/15 1:17
 */
@Component
public class TomcatPoolUtil {

    public Executor doGetTp(WebServer webServer) {
        TomcatWebServer tomcatWebServer = (TomcatWebServer) webServer;
        return tomcatWebServer.getTomcat().getConnector().getProtocolHandler().getExecutor();
    }
}
